#include "Port.h"

myCPort::myCPort(QObject *parent) : QObject(parent)
{
    m_bUsed = true;
}

myCPort::~myCPort()
{
    if(!m_units.empty())
    {
        vector<myCUnit*>::iterator iter = m_units.begin();
        vector<myCUnit*>::iterator iter_end = m_units.end();
        for ( ; iter != iter_end; iter++ )
        {
            myCUnit * pTempUnit = *iter;
            pTempUnit->deleteLater();
            pTempUnit = NULL;
        }
        m_units.clear();
    }
}

myCPort* myCPort::Clone()
{
    myCPort* pPort = qobject_cast<myCPort*>(myCPort::staticMetaObject.newInstance());
    pPort->m_strType = m_strType;
    return pPort;
}






